home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / Developer Essentials Jul 90 / U.S. System⁄HyperCard / HyperCard—US 1.2.5 / HyperCard Ideas-US 1.2.5 / Idea Stacks / Button Ideas / card_3330.txt < prev    next >
Encoding:
Text File  |  1987-11-25  |  19.6 KB  |  735 lines

  1. -- card: 3330 from stack: in
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 2106
  5. -- name: 
  6.  
  7.  
  8. -- part 1 (button)
  9. -- low flags: 00
  10. -- high flags: A003
  11. -- rect: left=32 top=97 right=119 bottom=130
  12. -- title width / last selected line: 0
  13. -- icon id / first selected line: 0 / 0
  14. -- text alignment: 1
  15. -- font id: 0
  16. -- text size: 12
  17. -- style flags: 0
  18. -- line height: 16
  19. -- part name: Next Card
  20. ----- HyperTalk script -----
  21. on mouseUp
  22.   go to next card
  23. end mouseUp
  24.  
  25.  
  26.  
  27.  
  28. -- part 2 (button)
  29. -- low flags: 00
  30. -- high flags: A003
  31. -- rect: left=31 top=135 right=157 bottom=129
  32. -- title width / last selected line: 0
  33. -- icon id / first selected line: 0 / 0
  34. -- text alignment: 1
  35. -- font id: 0
  36. -- text size: 12
  37. -- style flags: 0
  38. -- line height: 16
  39. -- part name: Prev Card
  40. ----- HyperTalk script -----
  41. on mouseUp
  42.   go to previous card
  43. end mouseUp
  44.  
  45.  
  46.  
  47.  
  48. -- part 3 (button)
  49. -- low flags: 00
  50. -- high flags: A003
  51. -- rect: left=32 top=172 right=193 bottom=131
  52. -- title width / last selected line: 0
  53. -- icon id / first selected line: 0 / 0
  54. -- text alignment: 1
  55. -- font id: 0
  56. -- text size: 12
  57. -- style flags: 0
  58. -- line height: 16
  59. -- part name: First Card
  60. ----- HyperTalk script -----
  61. on mouseUp
  62.   go to first card
  63. end mouseUp
  64.  
  65.  
  66.  
  67.  
  68. -- part 4 (button)
  69. -- low flags: 00
  70. -- high flags: A003
  71. -- rect: left=32 top=207 right=229 bottom=130
  72. -- title width / last selected line: 0
  73. -- icon id / first selected line: 0 / 0
  74. -- text alignment: 1
  75. -- font id: 0
  76. -- text size: 12
  77. -- style flags: 0
  78. -- line height: 16
  79. -- part name: Last Card
  80. ----- HyperTalk script -----
  81. on mouseUp
  82.   go to last card
  83. end mouseUp
  84.  
  85.  
  86.  
  87.  
  88. -- part 5 (button)
  89. -- low flags: 00
  90. -- high flags: A003
  91. -- rect: left=32 top=244 right=266 bottom=130
  92. -- title width / last selected line: 0
  93. -- icon id / first selected line: 0 / 0
  94. -- text alignment: 1
  95. -- font id: 0
  96. -- text size: 12
  97. -- style flags: 0
  98. -- line height: 16
  99. -- part name: Any Card
  100. ----- HyperTalk script -----
  101. on mouseUp
  102.   go to any card
  103. end mouseUp
  104.  
  105.  
  106.  
  107.  
  108. -- part 6 (button)
  109. -- low flags: 00
  110. -- high flags: A003
  111. -- rect: left=141 top=97 right=119 bottom=239
  112. -- title width / last selected line: 0
  113. -- icon id / first selected line: 0 / 0
  114. -- text alignment: 1
  115. -- font id: 0
  116. -- text size: 12
  117. -- style flags: 0
  118. -- line height: 16
  119. -- part name: Return
  120. ----- HyperTalk script -----
  121. on mouseUp
  122.   pop card
  123. end mouseUp
  124.  
  125.  
  126.  
  127.  
  128. -- part 7 (button)
  129. -- low flags: 00
  130. -- high flags: A003
  131. -- rect: left=143 top=135 right=157 bottom=241
  132. -- title width / last selected line: 0
  133. -- icon id / first selected line: 0 / 0
  134. -- text alignment: 1
  135. -- font id: 0
  136. -- text size: 12
  137. -- style flags: 0
  138. -- line height: 16
  139. -- part name: Home
  140. ----- HyperTalk script -----
  141. on mouseUp
  142.   visual effect iris close
  143.   go home
  144. end mouseUp
  145.  
  146.  
  147.  
  148.  
  149. -- part 8 (button)
  150. -- low flags: 00
  151. -- high flags: 8003
  152. -- rect: left=145 top=207 right=229 bottom=243
  153. -- title width / last selected line: 0
  154. -- icon id / first selected line: 0 / 0
  155. -- text alignment: 1
  156. -- font id: 0
  157. -- text size: 12
  158. -- style flags: 0
  159. -- line height: 16
  160. -- part name: Dial
  161. ----- HyperTalk script -----
  162. on mouseUp
  163.   get the selection
  164.   if it is empty then ask "Dial what number?"
  165.   if it is not empty then
  166.     push this card
  167.     visual effect zoom open
  168.     go to stack "Phone"
  169.     dial it
  170.     pop card
  171.   end if
  172. end mouseUp
  173.  
  174.  
  175.  
  176. -- part 9 (button)
  177. -- low flags: 00
  178. -- high flags: A003
  179. -- rect: left=144 top=245 right=267 bottom=242
  180. -- title width / last selected line: 0
  181. -- icon id / first selected line: 0 / 0
  182. -- text alignment: 1
  183. -- font id: 0
  184. -- text size: 12
  185. -- style flags: 0
  186. -- line height: 16
  187. -- part name: Show Cards
  188. ----- HyperTalk script -----
  189. on mouseUp
  190.   show all cards
  191. end mouseUp
  192.  
  193.  
  194.  
  195. -- part 16 (button)
  196. -- low flags: 00
  197. -- high flags: A003
  198. -- rect: left=144 top=171 right=193 bottom=242
  199. -- title width / last selected line: 0
  200. -- icon id / first selected line: 0 / 0
  201. -- text alignment: 1
  202. -- font id: 0
  203. -- text size: 12
  204. -- style flags: 0
  205. -- line height: 16
  206. -- part name: Help
  207. ----- HyperTalk script -----
  208. on mouseUp
  209.   help
  210. end mouseUp
  211.  
  212.  
  213.  
  214.  
  215. -- part 17 (button)
  216. -- low flags: 00
  217. -- high flags: A003
  218. -- rect: left=256 top=135 right=157 bottom=351
  219. -- title width / last selected line: 0
  220. -- icon id / first selected line: 0 / 0
  221. -- text alignment: 1
  222. -- font id: 0
  223. -- text size: 12
  224. -- style flags: 0
  225. -- line height: 16
  226. -- part name: Find
  227. ----- HyperTalk script -----
  228. on mouseUp
  229.   doMenu "Find..."
  230. end mouseUp
  231.  
  232.  
  233.  
  234. -- part 19 (button)
  235. -- low flags: 00
  236. -- high flags: A003
  237. -- rect: left=256 top=97 right=119 bottom=354
  238. -- title width / last selected line: 0
  239. -- icon id / first selected line: 0 / 0
  240. -- text alignment: 1
  241. -- font id: 0
  242. -- text size: 12
  243. -- style flags: 0
  244. -- line height: 16
  245. -- part name: Sort
  246. ----- HyperTalk script -----
  247. on mouseUp
  248.   answer "Sort all cards of this stack according to:" with "First Name" or "Last Name" or "Cancel"
  249.   if it is "First Name"
  250.   then sort by first word of first line of field 1
  251. else if it is "Last Name"
  252. then sort by last word of first line of field 1
  253. end mouseUp
  254.  
  255.  
  256.  
  257. -- part 33 (button)
  258. -- low flags: 00
  259. -- high flags: A003
  260. -- rect: left=258 top=171 right=192 bottom=353
  261. -- title width / last selected line: 0
  262. -- icon id / first selected line: 0 / 0
  263. -- text alignment: 1
  264. -- font id: 0
  265. -- text size: 12
  266. -- style flags: 0
  267. -- line height: 16
  268. -- part name: Import
  269. ----- HyperTalk script -----
  270. --Universal Import Button by Gary Bond
  271. --Copyright 1987 by Apple Computer, Inc.
  272. --Rev 3.1
  273.  
  274. on MouseUp
  275.   global CARDCOUNT,STARTCARD,LEVELMEMORY,HEADER
  276.   put the userLevel into LEVELMEMORY
  277.   set the userLevel to 5
  278.   set lockMessages to true
  279.   set lockScreen to true
  280.   put the short id of this card into STARTCARD
  281.   answer "Import text file as:" with "Data" or "Text" or "Cancel"
  282.   if it is "Data" then ImportData
  283.   else if it is "Text" then
  284.     answer "Include HEADER information in fields?" with "Yes" or "No"
  285.     put it into HEADER
  286.     ImporText
  287.   else CleanExit
  288.   go to next card
  289.   CleanExit "Compact"
  290. end MouseUp
  291.  
  292. on ImporText
  293.   global CARDCOUNT,STARTCARD,LEVELMEMORY,HEADER,FILENAME
  294.   put 0 into CARDCOUNT
  295.   repeat
  296.     ask "Name or pathname of text file to import:" with FILENAME
  297.     if it is empty then CleanExit
  298.     if short name of this stack is not in it then exit repeat
  299.     else answer "Can't import current stack!"
  300.   end repeat
  301.   put it into FILENAME
  302.   set cursor to 4  -- use system watch cursor
  303.   open file FILENAME
  304.   repeat
  305.     read from file FILENAME for 16384
  306.     if it is empty and CARDCOUNT is 0 then
  307.       answer "Could not find file:" && FILENAME with "OK"
  308.       close file FILENAME
  309.       CleanExit
  310.     end if
  311.     if it is empty then exit repeat
  312.     put return after it
  313.     if CARDCOUNT is 0 then
  314.       doMenu "New Background"
  315.       doMenu "New Field"
  316.       set the name of last bkgnd field to "Import"
  317.     else
  318.       doMenu "New Card"
  319.     end if
  320.     add 1 to CARDCOUNT
  321.     set the style of field "Import" to scrolling
  322.     set rect of field "Import" to 0,20,512,342
  323.     if HEADER is "Yes" then
  324.       put "Characters:" && number of characters in it & return & return before it
  325.       put "Lines:" && number of lines in it - 2 & return before it
  326.       put "File:" && FILENAME & return before it
  327.       put "Import card:" && CARDCOUNT & return before it
  328.     end if
  329.     put it into field "Import"
  330.   end repeat
  331.   close file FILENAME
  332.   if HEADER is "Yes" then
  333.     repeat until the short id of this card is STARTCARD
  334.       put " of" && CARDCOUNT after line 1 of field "Import"
  335.       go previous card
  336.     end repeat
  337.   else go card id STARTCARD
  338. end ImporText
  339.  
  340. on ImportData
  341.   global FILENAME,CARDCOUNT,STARTCARD,LEVELMEMORY,HEADER
  342.   put empty into delimiters
  343.   put 0 into CARDCOUNT
  344.   put 0 into limit
  345.   put 0 into fieldcount
  346.   put 0 into nofields
  347.   answer "Use Tab and Return as delimiters?" with "Yes" or "Other" or "Cancel"
  348.   if it is "Yes" then put "9,13" into delimiters
  349.   else if it is "Other" then
  350.     repeat until it < 256 and it > 0
  351.       ask "Enter an Ascii FIELD separator (0-255):" with 9
  352.       if it is empty then CleanExit
  353.     end repeat
  354.     put it into item 1 of delimiters
  355.     put 0 into it
  356.     repeat until it < 256 and it > 0
  357.       ask "Enter an Ascii RECORD separator (0-255):" with 13
  358.       if it is empty then CleanExit
  359.     end repeat
  360.     put it into item 2 of delimiters
  361.   else CleanExit
  362.   if item 1 of delimiters is item 2 of delimiters then put 1 into nofields
  363.   answer "Include header information in fields?" with "Yes" or "No"
  364.   put it into HEADER
  365.   repeat
  366.     ask "Name or pathname of text file to import:" with FILENAME
  367.     if it is empty then CleanExit
  368.     else if short name of this stack is not in it then exit repeat
  369.     else answer "Can't import current stack!"
  370.   end repeat
  371.   put it into FILENAME
  372.   set cursor to 4
  373.   open file FILENAME
  374.   repeat
  375.     read from file FILENAME until numToChar of item 2 of delimiters
  376.     if it is empty and CARDCOUNT is 0 then
  377.       answer "Could not find file:" && FILENAME with "OK"
  378.       close file FILENAME
  379.       CleanExit
  380.     end if
  381.     if it is empty then exit repeat
  382.     if charToNum(last character of it) is not item 2 of delimiters then
  383.       put item 2 of delimiters into temp
  384.       if temp is 9 then put "Tab" into temp
  385.       if temp is 13 then put "Return" into temp
  386.       answer "Can't find record delimiter:" && temp with "OK"
  387.       close file FILENAME
  388.       CleanExit
  389.     end if
  390.     if (numToChar of item 1 of delimiters) is not in it and nofields is 0 then
  391.       put item 1 of delimiters into temp
  392.       if temp is 9 then put "Tab" into temp
  393.       if temp is 13 then put "Return" into temp
  394.       answer "Can't find field delimiter:" && temp with "Help" or "OK"
  395.       if it is "Help" then
  396.         answer "Use double record delimiters for records..." with "Continue"
  397.         answer "with no field delimiters. Example: 13 & 13" with "OK"
  398.       end if
  399.       close file FILENAME
  400.       CleanExit
  401.     end if
  402.     repeat until "," is not in it
  403.       put numToChar(7) into character offset(",",it) of it
  404.     end repeat
  405.     if nofields is 0 then
  406.       put numToChar(item 1 of delimiters) & numToChar(item 1 of delimiters) into check
  407.       repeat until check is not in it
  408.         put numToChar(item 1 of delimiters) & quote & quote & numToChar(item 1 of delimiters) into char offset(check,it) to offset(check,it) + 1 of it
  409.       end repeat
  410.       put numToChar(item 1 of delimiters) & numToChar(item 2 of delimiters) into check
  411.       repeat until check is not in it
  412.         put numToChar(item 1 of delimiters) & quote & quote & numToChar(item 2 of delimiters) into char offset(check,it) to offset(check,it) + 1 of it
  413.       end repeat
  414.       repeat until (numToChar of item 1 of delimiters) is not in it
  415.         put "," into character offset((numToChar of item 1 of delimiters),it) of it
  416.       end repeat
  417.     end if
  418.     put empty into last character of it
  419.     if CARDCOUNT is 0 then doMenu "New Background"
  420.     else doMenu "New Card"
  421.     add 1 to CARDCOUNT
  422.     if nofields is 0 then put the number of items in it into limit
  423.     else put nofields into limit
  424.     repeat with count = 1 to limit
  425.       if CARDCOUNT is 1 then
  426.         add 1 to fieldcount
  427.         if fieldcount < 125 then
  428.           doMenu "New Field"
  429.           set rect of last bkgnd field to 30,120,482,205
  430.         else
  431.           answer "No more fields can be created!" with "OK"
  432.           Cleanexit "Compact"
  433.         end if
  434.       end if
  435.       put "Field" & count into fieldname
  436.       set name of bkgnd field (number of bkgnd fields) to fieldname
  437.       set style of bkgnd field fieldname to scrolling
  438.       If nofields is 0 and HEADER is "Yes" then
  439.         put "Field" && count && "of" && the number of items in it & return into bkgnd field fieldname
  440.         put "Record" && CARDCOUNT && "of file:" && FILENAME & return & return after bkgnd field fieldname
  441.       end if
  442.       if nofields is 0 then put item count of it after bkgnd field fieldname
  443.       else put it after bkgnd field fieldname
  444.       repeat until numToChar(7) is not in bkgnd field fieldname
  445.         put "," into character offset(numToChar(7),bkgnd field fieldname) of bkgnd field fieldname
  446.       end repeat
  447.     end repeat
  448.     choose browse tool
  449.   end repeat
  450.   close file FILENAME
  451.   go card id STARTCARD
  452. end ImportData
  453.  
  454. on CleanExit
  455.   global LEVELMEMORY
  456.   if param(1) is "Compact" then
  457.     doMenu "Compact Stack"
  458.   end if
  459.   choose browse tool
  460.   set the userLevel to LEVELMEMORY
  461.   set lockScreen to false
  462.   set lockMessages to false
  463.   exit to hypercard
  464. end CleanExit
  465.  
  466.  
  467. -- part 34 (button)
  468. -- low flags: 00
  469. -- high flags: A003
  470. -- rect: left=258 top=207 right=230 bottom=354
  471. -- title width / last selected line: 0
  472. -- icon id / first selected line: 0 / 0
  473. -- text alignment: 1
  474. -- font id: 0
  475. -- text size: 12
  476. -- style flags: 0
  477. -- line height: 16
  478. -- part name: Export Text
  479. ----- HyperTalk script -----
  480. --Export Text Button by Gary Bond
  481. --Copyright 1987 by Apple Computer, Inc.
  482. --Rev 3.6
  483.  
  484. On MouseUp
  485.   global LEVELMEMORY,STARTCARD,FIELDNAMES,FILENAME
  486.   put empty into FIELDNAMES
  487.   put the userlevel into LEVELMEMORY
  488.   set userLevel to 5
  489.   set lockMessages to true
  490.   put short id of this card into STARTCARD
  491.   Dialog
  492.   GetFilename
  493.   OpenFile
  494.   GetFieldData
  495.   close file FILENAME
  496.   CleanExit
  497. End MouseUp
  498.  
  499. On GetFileName
  500.   global FILENAME
  501.   ask "Name or pathname of text file to export to:" with FILENAME
  502.   if it is empty then CleanExit
  503.   put it into FILENAME
  504. End GetFileName
  505.  
  506. On OpenFile
  507.   global FILENAME,CONTENTS
  508.   open file FILENAME
  509.   read from file FILENAME for 100
  510.   close file FILENAME
  511.   if it is not empty then
  512.     repeat until it is "Replace"
  513.       answer "That file already exists..." with "Replace" or "Cancel"
  514.       if it is "Cancel" then GetFileName
  515.       else if it is "Replace" then open file FILENAME
  516.       else CleanExit
  517.     end repeat
  518.   else
  519.     open file FILENAME
  520.   end if
  521. End OpenFile
  522.  
  523. On GetFieldData
  524.   global FIELDNAMES,CONTENTS,FILENAME
  525.   set cursor to 4
  526.   put empty into CONTENTS
  527.   if FIELDNAMES is empty then CleanExit
  528.   put id of this background into backtemp
  529.   set lockScreen to true
  530.   go first card of this background
  531.   put id of this card into cardtemp
  532.   repeat
  533.     if id of this background is backtemp then
  534.       repeat with count = 1 to the number of lines in FIELDNAMES
  535.         do "put" && line count of FIELDNAMES && "& return after CONTENTS"
  536.         if number of chars in CONTENTS > 50000 then
  537.           write CONTENTS to file FILENAME
  538.           put empty into CONTENTS
  539.         end if
  540.       end repeat
  541.       go next card of this background
  542.     end if
  543.     if id of this card is cardtemp then exit repeat
  544.   end repeat
  545.   write CONTENTS to file FILENAME
  546.   set lockScreen to false
  547. End GetFieldData
  548.  
  549. On Dialog
  550.   global FIELDNAMES
  551.   if the number of background fields is 0 then
  552.     answer "No bkgnd fields on this card to export"
  553.     CleanExit
  554.   end if
  555.   answer "Export which background fields:" with "All" or "Some" or "Cancel"
  556.   if it is "All" then
  557.     set cursor to 4
  558.     repeat with count = 1 to the number of background fields
  559.       put (name of background field count) & return after FIELDNAMES
  560.     end repeat
  561.   else if it is "Some" then
  562.     repeat with count = 1 to the number of background fields
  563.       answer "Export field" && count & ":" && name of background field count with "Yes" or "No" or "Done"
  564.       if it is "Yes" then put (name of background field count) & return after FIELDNAMES
  565.       else if it is "No" then next repeat
  566.       else exit repeat
  567.     end repeat
  568.   else CleanExit
  569.   if FIELDNAMES is empty then CleanExit
  570. End Dialog
  571.  
  572. on CleanExit
  573.   global LEVELMEMORY,STARTCARD
  574.   choose browse tool
  575.   go to card id STARTCARD
  576.   set the userLevel to LEVELMEMORY
  577.   set lockScreen to false
  578.   set lockMessages to false
  579.   exit to hypercard
  580. end CleanExit
  581.  
  582.  
  583.  
  584.  
  585. -- part 35 (button)
  586. -- low flags: 00
  587. -- high flags: A003
  588. -- rect: left=257 top=243 right=266 bottom=355
  589. -- title width / last selected line: 0
  590. -- icon id / first selected line: 0 / 0
  591. -- text alignment: 1
  592. -- font id: 0
  593. -- text size: 12
  594. -- style flags: 0
  595. -- line height: 16
  596. -- part name: Export Data
  597. ----- HyperTalk script -----
  598. --Export Data Button by Gary Bond
  599. --Copyright 1987 by Apple Computer, Inc.
  600. --Rev 3.6
  601.  
  602. On MouseUp
  603.   global LEVELMEMORY,STARTCARD,FIELDNAMES,FILENAME
  604.   put empty into FIELDNAMES
  605.   put the userLevel into LEVELMEMORY
  606.   set userLevel to 5
  607.   set lockMessages to true
  608.   put short id of this card into STARTCARD
  609.   Dialog
  610.   GetFilename
  611.   OpenFile
  612.   GetFieldData
  613.   close file FILENAME
  614.   CleanExit
  615. End MouseUp
  616.  
  617. On GetFileName
  618.   global FILENAME
  619.   ask "Name or pathname of text file to export to:" with FILENAME
  620.   if it is empty then CleanExit
  621.   put it into FILENAME
  622. End GetFileName
  623.  
  624. On OpenFile
  625.   global FILENAME,CONTENTS
  626.   open file FILENAME
  627.   read from file FILENAME for 100
  628.   close file FILENAME
  629.   if it is not empty then
  630.     repeat until it is "Replace"
  631.       answer "That file already exists..." with "Replace" or "Cancel"
  632.       if it is "Cancel" then GetFileName
  633.       else if it is "Replace" then open file FILENAME
  634.       else CleanExit
  635.     end repeat
  636.   else
  637.     open file FILENAME
  638.   end if
  639. End OpenFile
  640.  
  641. On GetFieldData
  642.   global FIELDNAMES,CONTENTS,CONTINUEFLAG,FILENAME
  643.   put false into CONTINUEFLAG
  644.   put empty into delimiters
  645.   if number of background fields is 1 then
  646.     answer "When exporting a single field..." with "More"
  647.     answer "use the same field and record delimiter!" with "OK"
  648.   end if
  649.   answer "Use Tab and Return as delimiters?" with "Yes" or "Other" or "Cancel"
  650.   if it is "Yes" then put "9,13" into delimiters
  651.   else if it is "Other" then
  652.     repeat until it < 256 and it > 0
  653.       ask "Enter an Ascii FIELD separator (0-255):" with 9
  654.       if it is empty then CleanExit close
  655.     end repeat
  656.     put it into item 1 of delimiters
  657.     put 0 into it
  658.     repeat until it < 256 and it > 0
  659.       ask "Enter an Ascii RECORD separator (0-255):" with 13
  660.       if it is empty then CleanExit close
  661.     end repeat
  662.     put it into item 2 of delimiters
  663.   else CleanExit close
  664.   set cursor to 4
  665.   if FIELDNAMES is empty then CleanExit close
  666.   put empty into CONTENTS
  667.   put id of this background into backtemp
  668.   set lockScreen to true
  669.   go first card of this background
  670.   put id of this card into cardtemp
  671.   repeat
  672.     if id of this background is backtemp then
  673.       repeat with count = 1 to the number of lines in FIELDNAMES
  674.         do "get" && line count of FIELDNAMES
  675.         put it into temp
  676.         if numToChar(item 2 of delimiters) is in temp and CONTINUEFLAG is false then
  677.           answer "Found record delimiter:" && item 2 of delimiters && "in field data..." with "Continue" or "Exit"
  678.           if it is "Continue" then
  679.             put true into CONTINUEFLAG
  680.             set cursor to 4
  681.           else CleanExit close
  682.         end if
  683.         put temp after CONTENTS
  684.         put numToChar(item 1 of delimiters) after CONTENTS
  685.       end repeat
  686.       put numToChar(item 2 of delimiters) into last character of CONTENTS
  687.       go next card of this background
  688.     end if
  689.     write CONTENTS to file FILENAME
  690.     put empty into contents
  691.     if id of this card is cardtemp then exit repeat
  692.   end repeat
  693.   set lockScreen to false
  694. End GetFieldData
  695.  
  696. On Dialog
  697.   global FIELDNAMES
  698.   if the number of background fields is 0 then
  699.     answer "No bkgnd fields on this card to export"
  700.     CleanExit
  701.   end if
  702.   answer "Export which background fields:" with "All" or "Some" or "Cancel"
  703.   if it is "All" then
  704.     set cursor to 4
  705.     repeat with count = 1 to the number of background fields
  706.       put (name of background field count) & return after FIELDNAMES
  707.     end repeat
  708.   else if it is "Some" then
  709.     repeat with count = 1 to the number of background fields
  710.       answer "Export field" && count & ":" && name of background field count with "Yes" or "No" or "Done"
  711.       if it is "Yes" then put (name of background field count) & return after FIELDNAMES
  712.       else if it is "No" then next repeat
  713.       else exit repeat
  714.     end repeat
  715.   else CleanExit
  716.   if FIELDNAMES is empty then CleanExit
  717. End Dialog
  718.  
  719. on CleanExit
  720.   global LEVELMEMORY,STARTCARD,FILENAME
  721.   if param(1) is "close" then close file FILENAME
  722.   choose browse tool
  723.   go to card id STARTCARD
  724.   set the userLevel to LEVELMEMORY
  725.   set lockScreen to false
  726.   set lockMessages to false
  727.   exit to hypercard
  728. end CleanExit
  729.  
  730.  
  731.  
  732.  
  733. -- part contents for background part 1
  734. ----- text -----
  735. Text Buttons